﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Enferno.Public.Web.Models
{
    public class CustomerModel :
        CustomerBaseModel<CompanyModel, CompanyInformationModel, PersonInformationModel, AddressModel>
    {
        
    }

    public class CustomerBaseModel<TCompanyModel, TCompanyInformationModel, TPersonInformationModel, TAddressModel>
        where TCompanyModel: CompanyBaseModel<TCompanyInformationModel, TAddressModel>
        where TCompanyInformationModel: CompanyInformationModel
        where TPersonInformationModel: PersonInformationModel
        where TAddressModel: AddressModel
    {
        public int Id { get; set; }
        public string Code { get; set; }

        public TPersonInformationModel Person { get; set; }

        public TAddressModel InvoiceAddress { get; set; }
        public IEnumerable<TAddressModel> DeliveryAddresses { get; set; }
        public bool UseInvoiceAddressAsDeliveryAddress { get; set; }
        public IEnumerable<TCompanyModel> Companies { get; set; } 
    }
}
